'''
类中的方法
'''


class Student:
    def __init__(self, name, tel, age=18):
        self.name = name
        self.age = age
        self.tel = tel

    def study(self):
        print('%s is studying' % self.name)

    @classmethod
    def func1(cls):
        print('类方法')

    @staticmethod
    def func2():
        print('静态方法')


stu1 = Student('小猫', '110')
stu1.study()
Student.func1()


# 类方法与静态方法
class Math:
    pi = 3.1415926

    @classmethod
    def circle_area(cls, r):
        return cls.pi * r ** 2

    @staticmethod
    def sum(num1, num2):
        return num1 + num2
